<?php
/**
 * Created by JetBrains PhpStorm.
 * User: GMC
 * Date: 10/3/13
 * Time: 2:20 PM
 * To change this template use File | Settings | File Templates.
 */

class WidgetRightBanner extends CWidget {
    public $banners, $position;

    public function init() {
        $this->banners = Banner::model()->findAll(array(
            'select' => '*',
            'condition' => 'position = :position and type = 1',
            'params' => array(':position' => $this->position)
        ));
    }

    public function run() {
        return CWidget::render('widgetRightBanner', array('banners' => $this->banners));
    }
}